package com.codi.bus.core.dao;

import com.codi.base.dao.BaseDAO;
import com.codi.base.dao.v2.GeneratedBaseDao;
import com.codi.bus.core.domain.OrgFile;
import com.codi.bus.core.resultModel.OrganFileResult;

import java.util.List;

/**
 * 上传文件
 *
 * @author wangzhenhao
 * @date 2017-09-06 17:12
 */
public interface OrgFileDao extends BaseDAO<OrgFile> {
    Integer STATE_A = 1;
    Integer STATE_X = 0;

    /**
     * 通过主键删除文件
     *
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Long id);

    /**
     * 根据唯一的文件名删除文件
     *
     * @param uniqueFileName
     * @return
     */

    int deleteByUniqueFileName(String uniqueFileName);

    int insertSelective(OrgFile record);

    OrgFile selectByPrimaryKey(Long id);

    List<OrganFileResult> queryFiles(Integer pageIndex, Integer pageSize);

    List<OrganFileResult> queryFilesBySearchContent(Integer pageIndex, Integer pageSize, String searchContent);

    List<OrganFileResult> queryFilesByUserId(Long userId);

    List<OrganFileResult> queryFilesByUserIdAndProfileId(Long userId, Long profileId);

    List<OrganFileResult> queryFilesByProfileId(Long profileId);



    List<OrganFileResult> queryPictures(Integer pageIndex, Integer pageSize, String mimeType);

    int queryPictureCount(String mimeType);

    Long queryFilesCount();

    int updateByPrimaryKeySelective(OrgFile record);

    int updateByPrimaryKey(OrgFile record);

    int queryCountByFileName(String fileName, String mimeType);

    int queryCountByUserId(Long userId);

    int queryCountByUserIdANdFileType(Long userId, String fileType);

    OrgFile selectByUserIdAndFileType(Long userId, String fileType,Long profileId);

    OrgFile selectByUserIdAndFileTypeAndProfileId(Long userId, String fileType, Long profileId);

    List<OrganFileResult> queryFilesByFileName(String fileName, Integer pageIndex, Integer pageSize, String mimeType);
}
